Deprecate -e short flag for --project-endpoint in AI extensions#7313
Deprecate -e short flag for --project-endpoint in AI extensions#7313
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the -e shorthand for --project-endpoint in the AI extensions to avoid conflicting with azd’s global -e/--environment flag.
Changes:
- Dropped the
-eshorthand from--project-endpointin bothazure.ai.modelsandazure.ai.finetune. - Switched
StringVarPusages toStringVarfor the affected flags across init and persistent command setups.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cli/azd/extensions/azure.ai.models/internal/cmd/init.go | Removes -e shorthand from --project-endpoint on the init command. |
| cli/azd/extensions/azure.ai.models/internal/cmd/custom.go | Removes -e shorthand from --project-endpoint on the custom command persistent flags. |
| cli/azd/extensions/azure.ai.finetune/internal/cmd/operations.go | Removes -e shorthand from --project-endpoint on operations persistent flags. |
| cli/azd/extensions/azure.ai.finetune/internal/cmd/init.go | Removes -e shorthand from --project-endpoint on the init command. |
spboyer
left a comment
There was a problem hiding this comment.
Code Review
1. Error messages still reference removed -e shorthand
azure.ai.models/internal/cmd/custom.go:121-122 — Medium
After removing the -e short flag, the error message still says --project-endpoint (-e) and the example command uses -e directly (azd ai models custom list -e https://...). Users following this will get a flag parse error.
Fix: Update the error text and example to use only --project-endpoint.
2. Finetune validation still advertises removed -e
azure.ai.finetune/internal/cmd/validation.go:173 — Medium
The validation error instructs users to provide --project-endpoint (-e) but the shorthand no longer exists.
Fix: Remove (-e) from the message.
3. Fig completion snapshot still lists deleted shorthand
cli/azd/cmd/testdata/TestFigSpec.ts:457 — Medium
The snapshot still contains ['--project-endpoint', '-e'] entries. These need to be regenerated to match the new flag surface, or snapshot tests will fail.
e128b31 to
2bbcd90
Compare
|
Responding to @spboyer's review: 1 & 2. Error messages still reference removed -e shorthand Fixed in 512df88. Cleaned up all 4 locations:
3. Fig completion snapshot still lists deleted shorthand The fig snapshot in |
512df88 to
e5f24de
Compare
VSCode Extension Installation Instructions
|
e5f24de to
5ea4f88
Compare
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
wbreza
left a comment
There was a problem hiding this comment.
Code Review — PR #7313
Remove -e short flag from --project-endpoint in AI extensions by @jongio
Findings
| Priority | Count |
|---|---|
| Medium | 1 |
| Low | 3 |
| Total | 4 |
Prior Review Verification
spboyer's 3 findings all verified as fixed:
- ✅
custom.go:121-122error message —(-e)removed - ✅
validation.go:173—(-e)removed - ✅ Fig spec snapshot — not applicable (extension flags aren't in the snapshot)
What's Done Well
- Core changes are correct — all 4
StringVarP→StringVarconversions are precise - Clear PR description — acknowledges breaking change, explains why
-pisn't an alternative - Good cross-team coordination — holding PR for Foundry portal UI update
See inline comments below.
Review performed with GitHub Copilot CLI
wbreza
left a comment
There was a problem hiding this comment.
Re-Review — PR #7313 (1 new commit since Mar 30 review)
Prior Findings: All ✅ Resolved
| # | Priority | Finding | Status |
|---|---|---|---|
| 1 | Medium | Unrelated detect_confirm_apphost.go changes |
✅ Reverted |
| 2 | Low | Installation guide -e references |
✅ All 9 references updated |
| 3 | Low | Design spec -e references |
✅ Usage line and flag table updated |
| 4 | Low | Finetune CHANGELOG -e reference |
✅ (-e) removed |
Prior reviewer (spboyer) findings also verified as fixed:
- ✅ Error messages in
custom.go:121-122—(-e)removed - ✅ Validation message in
validation.go:173—(-e)removed - ✅ Fig spec snapshot — N/A (extension flags not in snapshot)
New Findings: None
No new issues found in the latest commit.
Note: Unresolved thread about Foundry portal UI dependency is a process/coordination concern, not a code defect.
Overall: ✅ APPROVE — all findings resolved, clean and complete removal of -e shorthand.
Review performed with GitHub Copilot CLI
e2b18af to
43799bb
Compare
|
Updated approach: deprecate -e instead of removing it Per team discussion, we're no longer removing -e entirely. Instead:
This eliminates the 3-week portal dependency. Combined with PR #7314 (lenient env name validation), both PRs can merge now without breaking anything. |
a8cbe89 to
534e92a
Compare
wbreza
left a comment
There was a problem hiding this comment.
Code Review — Remove -e Short Flag from AI Extensions
All 7 prior review findings (3 from spboyer, 4 from wbreza) have been verified as resolved ✅
✅ What Looks Good
- Smart approach pivot — switching from hard removal to ShorthandDeprecated preserves backward compatibility with built-in pflag deprecation warnings
- Thorough documentation sweep — all -e references updated across design spec, installation guide, CHANGELOG, error messages, and validation
- Correct flag set matching — every Lookup() call uses the same flag set where the flag was registered
Findings
| Priority | Count |
|---|---|
| Medium | 1 |
| Low | 1 |
[Medium] The ShorthandDeprecated message says "will be removed after April 2025" — that date is ~11 months in the past (PR created March 2026). Consider updating to a future date so the deprecation warning remains credible to users.
[Low] The �zure.ai.finetune CHANGELOG was updated to remove (-e) references, but �zure.ai.models has no corresponding CHANGELOG entry for this deprecation.
Overall: Well-implemented deprecation approach. All prior feedback resolved. The stale date is a quick one-line fix in 4 files.
The azure.ai.models and azure.ai.finetune extensions were using -e as a shorthand for --project-endpoint, which conflicts with azd's global -e for --environment. This collision caused #7271 when azd tried to parse -e globally and received a URL instead of an environment name. Drop the -e shorthand entirely from --project-endpoint. Users can still pass the full --project-endpoint flag. The -p shorthand was not usable as a replacement because init commands already use -p for --project-resource-id. Closes #7308 Closes #7309 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…docs Clean up error messages, validation text, design spec, and installation guide that still referenced the removed (-e) shorthand for --project-endpoint. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… remaining -e references in docs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep -e working for backward compatibility with existing portal CLI commands and user workflows. Mark it as deprecated via pflag's ShorthandDeprecated so users see a warning nudging them to --project-endpoint. Full removal planned after April 2025. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Update ShorthandDeprecated messages from 'April 2025' to 'a future release' - Add -e deprecation entry to azure.ai.models CHANGELOG Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
892a9f5 to
1d1ec48
Compare
wbreza
left a comment
There was a problem hiding this comment.
Code Review — PR #7313: Deprecate -e short flag for --project-endpoint
All 11 prior review findings verified as resolved ✅
| Reviewer | Findings | Status |
|---|---|---|
| copilot-pull-request-reviewer | 1 | ✅ All resolved |
| spboyer | 3 | ✅ All resolved |
| achauhan-scc | 1 | ✅ Resolved via approach change |
| wbreza (3 reviews) | 6 | ✅ All resolved |
✅ What Looks Good
- Smart approach pivot —
ShorthandDeprecatedpreserves backward compatibility while nudging users to migrate - Thorough documentation sweep — all
-ereferences updated across design spec, installation guide, CHANGELOG, error messages, and code examples - Consistent deprecation messages — all 4
ShorthandDeprecatedassignments use identical wording with no stale dates - Correct flag set matching — every
Lookup()call uses the same flag set (Flags()vsPersistentFlags()) where the flag was registered
One Low Note
The azure.ai.finetune CHANGELOG only edits an existing v0.0.16-preview entry to remove (-e) — it doesn't add a dedicated deprecation entry like azure.ai.models v0.0.5-preview does. Can be addressed when the next finetune version is cut.
Overall: ✅ APPROVE — clean, complete deprecation. All prior feedback resolved.
Review performed with GitHub Copilot CLI
- Add 1.24.0 (Unreleased) CHANGELOG section documenting: - --non-interactive flag alias and AZD_NON_INTERACTIVE env var (Azure#7392) - Hooks per provisioning layer in azure.yaml (Azure#7382) - Docker build network option in azure.yaml (Azure#7361) - Improved azd update error message for admin-managed installs (Azure#7417) - Deprecation of -e short flag in AI extensions (Azure#7313) - Add AZD_NON_INTERACTIVE to environment-variables.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Deprecates the
-eshort flag for--project-endpointin both azure.ai.models and azure.ai.finetune extensions, keeping it functional with a deprecation warning. The-eflag conflicts with azd's global--environmentflag.What changed
In 4 files, restored
StringVarP(keeping-eshorthand) and addedShorthandDeprecatedso users see a deprecation warning when using-e:extensions/azure.ai.models/internal/cmd/custom.go- PersistentFlagsextensions/azure.ai.models/internal/cmd/init.go- Flagsextensions/azure.ai.finetune/internal/cmd/init.go- Flagsextensions/azure.ai.finetune/internal/cmd/operations.go- PersistentFlagsAlso updated:
extensions/azure.ai.models/CHANGELOG.md- Added deprecation entryextensions/azure.ai.models/docs/installation-guide.md- Marked-eas (deprecated)Approach: Deprecate, don't remove
Instead of immediately removing
-e(which would break existing portal CLI commands and user workflows), we mark it as deprecated via pflag'sShorthandDeprecated. This means:-e <URL>still works — existing commands keep functioning--project-endpointinsteadWhy not -p?
We couldn't migrate to
-pbecause it's already used by--project-resource-idin both extensions' init.go files.Closes #7308
Closes #7309
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com